OpenAI API の概要を理解しておく
ChatGPT、DALL·E、Whisper 等のプロダクトで知られる OpenAI の API の概要を把握すべく 2023-01-26 に軽く触ってみたので、メモを残す。
https://beta.openai.com/docs/introduction
素直にここから読んでいった
https://beta.openai.com/docs/quickstart
こういうことができるよ、って話
Content generation
Summarization
Classification, categorization, and sentiment analysis
Data extraction
Translation
Many more!
ブラウザ上で動くデモに触れながら Completion を学んでいく
Completion は日本語でいうと「補完」ってところかね?
temperature というパラメータを指定する
0 〜 1 の値
1 に近いほど結果のばらつきが大きくなる
Node.js 製のサンプル
https://github.com/openai/openai-quickstart-node
起動すると http://localhost:3000/ でウェブアプリケーションが動く
https://beta.openai.com/account/api-keys
https://beta.openai.com/docs/libraries
Python と Node.js の公式ライブラリがある
他の言語のライブラリは野良でつくられている
https://beta.openai.com/docs/models
GPT-3
自然言語の読み書きができる
Codex
プログラミング言語を扱える
GitHub 上で公開されているソースコードたちを学習データとしている
They’re most capable in Python and proficient in over a dozen languages including JavaScript, Go, Perl, PHP, Ruby, Swift, TypeScript, SQL, and even Shell.
https://beta.openai.com/docs/usage-policies
悲しいことをやっちゃダメだよ、って話
https://beta.openai.com/docs/guides/completion
自然言語のテキスト補完
https://beta.openai.com/docs/guides/code
プログラミング言語のコード補完
https://beta.openai.com/docs/guides/images
画像生成
DALL·E の裏側みたいな話
https://beta.openai.com/docs/guides/fine-tuning
モデルのチューニング方法
https://beta.openai.com/docs/guides/embeddings/what-are-embeddings
Embedding、埋め込み?
こういうことに使えるよ
Search (where results are ranked by relevance to a query string)
Clustering (where text strings are grouped by similarity)
Recommendations (where items with related text strings are recommended)
Anomaly detection (where outliers with little relatedness are identified)
Diversity measurement (where similarity distributions are analyzed)
Classification (where text strings are classified by their most similar label)
あんまりわかっていない
https://beta.openai.com/docs/guides/moderation
Moderation って日本語だとなんだろう、検閲みたいな?
Content Filtering、コンテンツ・フィルタリング
こういうのを抽出できる
hate
hate/threatening
self-harm
sexual
sexual/minors
violence
violence/graphic
https://beta.openai.com/docs/guides/rate-limits
https://beta.openai.com/docs/guides/error-codes
https://beta.openai.com/docs/guides/safety-best-practices
https://beta.openai.com/docs/api-reference/introduction